-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Faster webpack compile time #39
Conversation
6518ec0
to
da7b43e
Compare
This is awesome @codingluke! Indeed on our app this speeds up recompilation time ~3x. Maybe we could organize the files a bit differently such as:
// base.scss
// This injects Tailwind's base styles, which is a combination of Normalize.css and additional base styles.
@import 'tailwindcss/base';
// Add custom base styles, applied after the tailwind-base classes // components.scss
`@import 'tailwindcss/components';`
// Custom components.... // utilities.scss
// This injects all of Tailwind's utility classes, generated based on your config file.
@import 'tailwindcss/utilities';
// Include vendor css. // application.js
// These are imported separately for faster Webpack recompilation
import "stylesheets/base.scss"
import "stylesheets/components.scss"
import "stylesheets/utilities.scss" |
Hi @dixpac, Thanks for your input :) I see your point! However, isn't |
@dixpac, I just checked the benchmarks, it is totally fine with your structure too 👍 So when everybody can confirm on this I will adapt it. |
da7b43e
to
a4315c1
Compare
@import "tailwindcss/components"; | ||
|
||
// Import components added to `./components/` here | ||
// https://tailwindcss.com/docs/extracting-components |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dixpac why do we need the special components folder? There is also no folder to structure the base styles (and I would do this too).
I see two ways here:
- Everybody should add the own structure
- We give them a structure (CoC). Just to do that, I am not too much experienced with tailwind ;)
a4315c1
to
4a699c5
Compare
Hi there,
when adding custom CSS into a separate file, webpack should not have to compile the whole tailwindcss again, but only the changes in
application.scss
.Moreover, I personally like it to have the custom CSS in a separate file and not in between the tailwind includes.
See: tailwindlabs/tailwindcss#443 (comment)
Before
After
I hope this will help others too. 😄